﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using DataAccess;
using Model;

namespace Business.WPF
{
    public class NewStudentRegistrationManager
    {
        public Student NewStudent(string name, string lastname, string mlastname, string sex,
                                  string birthplace, DateTime birthday, string issuedIn, string liceAero,
                                  string profession, string address, string zone, string telephone, string email,
                                  int id,string fName, string fProfession, string mName, string mProfession, string observations)
        {
            Student student = new Student
            {
                name = name,
                lastname = lastname,
                mlastname = mlastname,
                sex = sex,
                birthday = birthday,
                birthplace = birthplace,
                id = id,
                issuedIn = issuedIn,
                liceAero = liceAero,
                profession = profession,
                address = address,
                zone = zone,
                telephone = telephone,
                email = email,
                fName = fName,
                fProfession = fProfession,
                mName = mName,
                mProfession = mProfession,
                observations = observations

            };
            student = StudentDataAccess.NewStudent(student);
            return student;
        }
        public Student ModifyStudent(string name, string lastname, string mlastname, string sex,
                                  string birthplace, DateTime birthday, string issuedIn, string liceAero,
                                  string profession, string address, string zone, string telephone, string email,
                                  int id, string fName, string fProfession, string mName, string mProfession, string observations)
        {
            Student student = new Student
            {
                name = name,
                lastname = lastname,
                mlastname = mlastname,
                sex = sex,
                birthday = birthday,
                birthplace = birthplace,
                id = id,
                issuedIn = issuedIn,
                liceAero = liceAero,
                profession = profession,
                address = address,
                zone = zone,
                telephone = telephone,
                email = email,
                fName = fName,
                fProfession = fProfession,
                mName = mName,
                mProfession = mProfession,
                observations = observations

            };
            student = StudentDataAccess.ModifyStudent(student);
            return student;
        }
        public bool StudentAlreadyRegistered(int id)
        {
            if (StudentDataAccess.GetOneStudentByID(id) != null)
                return true;
            return false;
        }
    }
}
